package org.eduapp.trains.service.account;

import java.util.List;

import org.eduapp.trains.ServiceException;
import org.eduapp.trains.model.account.ModelAccount;
import org.eduapp.trains.web.support.PaginationSupport;


/**
 * 
 * @author jeccy
 *
 */
public interface AccountService {
	
	/**
	 * get account by given id
	 * @param id
	 * @return
	 * @throws ServiceException
	 */
	ModelAccount get (String id) throws ServiceException;
	
	/**
	 * get account by given account no
	 * @param accountNo
	 * @return
	 * @throws ServiceException
	 */
	ModelAccount getByNo (String accountNo) throws ServiceException;
	
	/**
	 * get accounts by pager
	 * @param model
	 * @param pageSize
	 * @param offset
	 * @param order
	 * @param isDesc
	 * @return
	 * @throws ServiceException
	 */
	PaginationSupport<ModelAccount> get(ModelAccount model, int pageSize, int offset, String order, Boolean isDesc)
		throws ServiceException;
	
	/**
	 * get account by model object
	 * @param model
	 * @return
	 * @throws ServiceException
	 */
	List<ModelAccount> getByModel (ModelAccount model) throws ServiceException;
	
	/**
	 * remove account by given id
	 * @param id
	 * @return
	 * @throws ServiceException
	 */
	boolean remove (String id) throws ServiceException;
	
	/**
	 * save or update account by given model object
	 * @param model
	 * @return
	 * @throws ServiceException
	 */
	boolean saveOrUpdate (ModelAccount model) throws ServiceException;
	
	
	ModelAccount getAccountAuth(String username, String password);
	
}
